package com.wpzf.ndhc.utils;

public class WpzfNdhcStringUtils {

    public static String truncateString(String tbbh) {
        try {
            String[] arr = tbbh.split(","); //逗号隔开
            if (arr.length >3) {
                int firstCommaIndex = tbbh.indexOf(',', tbbh.indexOf(',', tbbh.indexOf(',') + 1) + 1);
                return tbbh.substring(0, firstCommaIndex);
            } else {
                return tbbh;
            }
        } catch (Exception ex) {
            System.out.println(ex.toString());
        }
        return "";
    }

}
